This folder contains the replication materials for the paper "A general model of abstention under compulsory voting" (Katz and Levin), 
to appear in Political Science Research and Methods. 
These replication materials include:

1) "Replication.R", the master file. It loads all the data sets, computes the descriptive statistics reported in the paper and in the 
    Online Appendix, fits the models reported in Tables 1-2 of the text and Tables A.3, A.7, A.8 and A.9 of the Online Appendix using 
    Markov chain Monte Carlo methods, and generates all the figures included in both the paper and the Appendix. 
    

For the code to work properly you have to install R (64-bit) and WinBUGS, adjust the paths (including the bugs.directory) in "Replication.R", and install the following R packages:
    "ggplot2", "MCMCpack", "mvtnorm", "spam" and "R2WinBUGS". The script can take considerable time to run (3-4 days in 64-bit Windows) if no cluster computing facilities are available 
    (which we do not assume available in these replication materials).


2) The ".bug" files needed to estimate the district-level models in WinBUGS:
    
	- "compositional.19862014.bug", used to estimate the basic district-level model in columns 1-2 of Table 2 and the model in Table A.8 of the Online Appendix.

	- "compositional.19862014.interaction.bug", used to estimate the model interacting "Illiterates" with "Electronic Voting" (columns 3-4 of Table 2).

	- "PooledOLS.bug", used to estimate the ordinary least squares (OLS) regressions for invalid voting and absenteeism (Table A.3 and Figure A.5 of the Online Appendix).

	- "Multilevelregression.bug", used to estimate the hierarchical linear regression models (HLM) fitted to both sources of abstention (Tables A.3 and A.4 and Figure A.5 of the Online Appendix).

	- "compositional.longdistrict.bug", used to estimate the "long-term" district level model that incorporates a measure of political rights and civil liberties as a predictor for 
	   elections between 1974 and 2014 (Table A.9 of the Online Appendix).

All these files run in WinBUGS and are called from R, as part of the "Replication.R" file. 
The MCMC algorithmS to fit the individual-level modelS in Table 1 of the paper and Table A.7 of the Online Appendix
were implemented directly in R, and are included in "Replication.R" as well.


3) All the data sets employed in the analysis:

	- "individual.2002.2010.csv", used to estimate the individual-level model (Table 1 of the paper and Tables A.5-A.7 of the Online Appendix).

	- "district.1986.2014.csv", used to estimate the baseline district-level models (Table 2 of the paper and Tables A.3, A.4 and A.8 of the Online Appendix).

	- "supplementary.district.1974.2014.csv", used to estimate the "long-term" district-level model (Table A.9 of the Online Appendix).
 

VARIABLES: The names of the variables in these different data files are self-explanatory, and match the names of the variables used in the paper and defined in Section 4 of the paper ("Data and methods") and 
Section A.1 of the Online Appendix ("Coding and descriptive statistics for the variables included in the empirical analysis").
 
	a) The "individual.2002.2010.csv" file includes the following variables required to run the individual-level model:
  		"Invalid", "Absentee", "Valid", "Dissatisfaction.democracy", "Married", "Female", "Union", "Religion", "Young", 
		"Seniors","Age", "Illiterates", "Secondary", "University", "Income", "Political.inefficacy", "No.representation", 
		"Political.knowledge", "PT", "PSDB", "PMDB", "Candidates", "Competition", "Urban", "TRE" (Clearance Rate), "Growth", "Inflation"
	   and indicators for "State" and "Year" (election).
           The coding and source for all the variables is given in the Online Appendix (Section A.1.)  


	b) The file "district.1986.2014.csv" includes the following predictors included in the basic district-level models: 
		- "Invalid", "Absentee", "Valid", "Illiterates", "Urban", "Candidates", "Competition", "Seniors", "Young", "TRE"(Clearance Rate"), "Electronic.Vote", "Growth", "Inflation", and "Income", along with
 		indicators for "State" and "Year" (election).            
	   The coding and source for all the variables is given in the Online Appendix (Section A.1.)  


	c) In the file ""supplementary.district.1974.2014.csv", we include the variables needed to estimate the district-level model that incorporates a measure of political rights and civil liberties as predictor 
	   for elections between 1974 and 2014 (Table A.9 in the Online Appendix). This is the variable labelled as "Dif.Inverse.Fscores", the annual percentage change in Freedom House inverse combined ratings for 
	   political rights and civil liberties (Vanhanen 2000). The other predictors in the model are "Invalid", "Absentee", "Valid", "Illiterates", "Urban", "Candidates", "Competition", "Seniors", "Young", 
	   "Electronic.Vote", "Growth", and "Inflation". See the Online Appendix for the coding and sources of these variables. 


AUTHORS' CONTACT INFORMATION:			

Gabriel Katz, Senior Lecturer in Politics, Department of Politics, 
University of Exeter, Amory Building, Rennes Drive, Exeter, EX4 4QJ, UK
(email: G.Katz@exeter.ac.uk).

Ines Levin, Assistant Professor, Department of Political Science, 
University of California, Irvine, 3151 Social Science Plaza B, Irvine, CA 92697, US
(email: i.levin@uci.edu). 





